require(['./config'],() => {
   require(['template','header','footer','swiper'],(template) => {
     class HomePage {
       constructor () {
        this.lunbo()
        this.rapList()
        this.PddList()
       }
       lunbo () {
          new Swiper('.swiper-container', {
          autoplay: true,
          loop: true, // 循环模式选项

          // 如果需要分页器
          pagination: {
              el: '.swiper-pagination',
          }
      })
      new Swiper('.swiper-cont', {
          autoplay: true,
          direction: 'vertical', // 垂直切换选项
          loop: true // 循环模式选项

      })  }
      rapList () {
        $.get('http://rap2.taobao.org:38080/app/mock/259937/home/brandShow',resp => {
          if(resp.code === 200) {
            const { data } = resp
            $('#brandInfoList').html(template('homeBrandShow',{ list: data }))
          }
        })
      }
      PddList () {
        $.get('/api/gindex/subject/limited/goods',{
          subject_id:39275,
          page:1,
          size:50
        },resp => {
          if(resp.result) {
            const { data } = resp
            $('#PddList').html(template('PddListtemplate',{ pddlist: data.slice(0,5) }))
          }
        })
      }

       }

    new HomePage()
   })
 })